import {Navigate, NonIndexRouteObject, useRoutes} from "react-router-dom";
import {lazy} from "react";
import menuRouter from "@/router/menuRouter.tsx";


const routes: NonIndexRouteObject[] = [
    menuRouter,
    {
        path: '/',
        element: <Navigate to="/system/home"/>
    },
    {
        path: '/login',
        Component: lazy(() => import("@/views/Login"))
    },
    {
        path: "/403",
        Component: lazy(() => import("@/views/Dashboard"))
    },
    {
        path: "/error",
        Component: lazy(() => import("@/views/TipPage/Error"))
    },
    {
        path: "*",
        Component: lazy(() => import("@/views/TipPage/404"))
    },
]
const Router = () => {
    return useRoutes(routes);
};
export default Router
